﻿<%@ Page Language="C#" MasterPageFile="~/InventoryTracker/MasterPage.master" AutoEventWireup="true" CodeFile="MaterialMaster.aspx.cs" Inherits="InventoryTracker_MaterialMaster1" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="maincontent" Runat="Server">

    <div id="projectreport">
        <a name="content_start0" id="content_start0"></a>
        <fieldset>
            <h2 class="none">
                Material Mastert</h2>
            <legend>Material Information</legend>
            <div class="formsection">
                Material</div>
            
            <table style="width: 358px" >
            <tr>
            <td>
            <asp:DropDownList ID="DdlItemName" runat="server" AutoPostBack="True" 
                    DataSourceID="SqlDSItemName" DataTextField="ItemName" DataValueField="ItemCode" 
                    onselectedindexchanged="DdlItemName_SelectedIndexChanged"></asp:DropDownList>
                <asp:SqlDataSource ID="SqlDSItemName" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    SelectCommand="SELECT [ItemCode], [ItemName] FROM [MaterialMaster]">
                </asp:SqlDataSource>
            </td>
            
                <td style="width: 100px">
                    
                    <p style="height: 35px; width: 170px">
                        
                        <asp:Label ID="lblMatItemName" runat="server" Text="Item Name"></asp:Label>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtMatItemName" ErrorMessage="*" 
        ToolTip="Contact No is required."></asp:RequiredFieldValidator>
                        <br />
                        
        <asp:TextBox ID="txtMatItemName" runat="server"></asp:TextBox><br />
                    </p>
                    <p style="width: 170px">
                        <asp:Label ID="lblMatItemDescription" runat="server" 
        Text="Item Description" ></asp:Label>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="txtMatItemDescription" ErrorMessage="*" 
        ToolTip="Item Description is required."></asp:RequiredFieldValidator>
        <asp:TextBox ID="txtMatItemDescription" runat="server" ></asp:TextBox>
        <br />
                    </p>
                    <p style="width: 170px">
                        <asp:Label ID="lblMatItemType" runat="server" Text="Item Type"></asp:Label>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="txtMatItemType" ErrorMessage="*" 
        ToolTip="Item Type is required."></asp:RequiredFieldValidator>
                        <br />
        <asp:TextBox ID="txtMatItemType" runat="server" ></asp:TextBox>
        <br />
                    </p>
                    <p style="width: 170px">
                        <asp:Label ID="lblMatItemCategory" runat="server" Text="Item Category"></asp:Label>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="txtMatItemCategory" ErrorMessage="*" 
        ToolTip="Item Category is required."></asp:RequiredFieldValidator>
        <asp:TextBox ID="txtMatItemCategory" runat="server" ></asp:TextBox>
        <br />
                    </p>
                    
                    <p style="width: 170px">
                    <asp:Label ID="lbluomID" runat="server" Text="Unit Of Measurement ID"></asp:Label>
                    <br />
                    <asp:DropDownList ID="ddruomID" runat="server" DataSourceID="uomDaSo" 
                            DataTextField="uom" DataValueField="uomID" Height="22px" Width="128px" Visible="true"></asp:DropDownList>
                        <asp:SqlDataSource ID="uomDaSo" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                            SelectCommand="SELECT * FROM [uom]"></asp:SqlDataSource>
                            <asp:TextBox ID="txtuomName" runat="server" Visible="false"></asp:TextBox>
                    </p>
                    
                   
                    
                    <p style="width: 170px">
                        <asp:Label ID="lblMatLength" runat="server" Text="Length"></asp:Label><br />
        <asp:TextBox ID="txtMatLength" runat="server" ></asp:TextBox>
        
        <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                            ControlToValidate="txtMatLength" ErrorMessage="Enter only Numbers ." 
                            ValidationExpression="^\d*\.?\d*$"></asp:RegularExpressionValidator>
                    </p>
            
                    <p style="width: 170px">
                        <asp:Label ID="lblMatWidth" runat="server" Text="Width"></asp:Label><br />
        <asp:TextBox ID="txtMatWidth" runat="server" ></asp:TextBox>
        
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                            ControlToValidate="txtMatWidth" ErrorMessage="Enter only Numbers ." 
                            ValidationExpression="^\d*\.?\d*$"></asp:RegularExpressionValidator>
                    </p>
                    
                     </td>
                    <td style="width: 169px">
           
                   <p style="width: 170px; top: 76px; left: 402px; position: absolute; height: 35px;">
                     <asp:Label ID="lblMatHeigth" runat="server" Text="Heigth"></asp:Label><br />
        <asp:TextBox ID="txtMatHeigth" runat="server" ></asp:TextBox>
        
        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                            ControlToValidate="txtMatHeigth" ErrorMessage="Enter only Numbers ." 
                            ValidationExpression="^\d*\.?\d*$"></asp:RegularExpressionValidator>
        
                    </p>
                    <p style="width: 170px; height: 35px; margin-right: 0px;">
                        <asp:Label ID="lblMatWeight" runat="server" Text="Weight"></asp:Label>
                        <br />
                        
                        <asp:TextBox ID="txtMatWeight" runat="server"></asp:TextBox>
                        
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" 
                            ControlToValidate="txtMatWeight" ErrorMessage="Enter only Numbers ." 
                            ValidationExpression="^\d*\.?\d*$"></asp:RegularExpressionValidator>
                    </p>
                    <p style="width: 170px">
                        <asp:Label ID="lblMatReorderQty" runat="server" Text="Reorder Quantity"></asp:Label>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                    ControlToValidate="txtMatReorderQty" ErrorMessage="*" 
        ToolTip="Reorder Quantity is required."></asp:RequiredFieldValidator>
            
                        <asp:TextBox ID="txtMatReorderQty" runat="server" ></asp:TextBox>
                        <br />
                        
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                            ControlToValidate="txtMatReorderQty" ErrorMessage="Enter only Numbers ." 
                            ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
                        
                        
                    </p>
                    <p style="width: 170px">
                        <asp:Label ID="lblMatReorderPoint" runat="server" Text="Reorder Point"></asp:Label>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                    ControlToValidate="txtReorderPoint" ErrorMessage="*" 
        ToolTip="Reorder Point is required."></asp:RequiredFieldValidator>
                        <br />
                        
                        <asp:TextBox ID="txtReorderPoint" runat="server" ></asp:TextBox>
                        <br />
                        
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" 
                            ControlToValidate="txtReorderPoint" ErrorMessage="Enter only Numbers ." 
                            ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
                        
                    </p>
                    <p style="width: 170px">
                        <asp:Label ID="lblMatSellingRate" runat="server" Text="Selling Rate"></asp:Label>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                    ControlToValidate="txtMatSellingRate" ErrorMessage="*" 
        ToolTip="Selling Rate is required."></asp:RequiredFieldValidator>
                        <br />
                        
                        <asp:TextBox ID="txtMatSellingRate" runat="server"></asp:TextBox>
                        <br />
                        
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" 
                            ControlToValidate="txtMatSellingRate" ErrorMessage="Enter only Numbers ." 
                            ValidationExpression="^\d*\.?\d*$"></asp:RegularExpressionValidator>
                        
                    </p>
                    <p style="width: 170px">
                    <asp:Label ID="lblLocationID" runat="server" Text="LocationID"></asp:Label>
                    <br />
                    <asp:DropDownList ID="ddrLocationID" runat="server" 
                            DataSourceID="LocIDDaSo" DataTextField="LocationName" 
                            DataValueField="LocationID" Height="22px" Width="128px" Visible="true"></asp:DropDownList>
                        <asp:SqlDataSource ID="LocIDDaSo" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                            SelectCommand="SELECT * FROM [LocationMaster]"></asp:SqlDataSource>
                            <asp:TextBox ID="txtLocName" runat="server" Visible="false"></asp:TextBox>
                    </p>
                    
            </td>
            </tr>
            </table>
            
            <asp:Label ID="lblWarn" runat="server" Text="* Required Fields" 
                ForeColor="Red"></asp:Label>
            <div class="formsection">
                <asp:Button ID="btnMatSubmit" runat="server"  Text="Submit" 
                    onclick="btnMatSubmit_Click"/>
                    <asp:Button ID="btnNew" runat="server"  Text="New" 
                    onclick="btnNew_Click"/>
                    <asp:Button ID="btnMatDelete" runat="server" Text="Delete" onclick="btnMatDelete_Click" 
                    ></asp:Button>
                    <asp:Button ID="btnMatEdit" runat="server" Text="Edit" 
                    onclick="btnMatEdit_Click"></asp:Button>
                    <asp:Button ID="btnMatUpdate" runat="server" Text="Update" 
                    onclick="btnMatUpdate_Click"></asp:Button>
                <asp:Label ID="lblResult" runat="server"></asp:Label>
            </div>
        </fieldset>
    </div>








</asp:Content>

